<script setup>
import {ref,onMounted} from 'vue'
import axios from 'axios'
import {useRoute,useRouter} from 'vue-router'

const route = useRoute();
const router = useRouter(); 
const detail = ref({})
onMounted(async()=>{
  console.log(route.query.id);
  let id = route.query.id;
  let res =await axios.get(`http://127.0.0.1:7003/api/detail?id=${id}`);
  detail.value = res.data;
})
</script>
<template>
    <div class="detail">
        <div class="detail-img">
            <img :src="detail.url" alt="">
        </div>
        <div class="detail-item">
            <div class="detail-title">{{detail.title}}</div>
            <div class="detail-info">{{detail.desc}}</div>
        </div>
    </div>
</template>
<style scoped>

</style>